-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for znode flag #19
Add support for znode flag #19
Conversation
This allows for the aurora scheduler znode to be passed as a flag at runtime.
finder.go
Outdated
zkLeaderPrefix = "singleton_candidate_" | ||
) | ||
|
||
type finder interface { | ||
leaderURL() (string, error) | ||
} | ||
|
||
func newFinder(url string) (f finder, err error) { | ||
func newFinder(url string, znode string) (f finder, err error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: you only need to specify the type once: url, znode string
finder.go
Outdated
@@ -86,7 +85,7 @@ type zkFinder struct { | |||
leaderIP string | |||
} | |||
|
|||
func newZkFinder(url string) *zkFinder { | |||
func newZkFinder(url string, znode string) *zkFinder { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
main.go
Outdated
@@ -21,6 +21,7 @@ var ( | |||
addr = flag.String("web.listen-address", ":9113", "Address to listen on for web interface and telemetry.") | |||
auroraURL = flag.String("exporter.aurora-url", "http://127.0.0.1:8081", "URL to an Aurora scheduler or ZooKeeper ensemble") | |||
metricPath = flag.String("web.telemetry-path", "/metrics", "Path under which to expose metrics.") | |||
zkPath = flag.String("zk.path", "/aurora/scheduler", "zkNode that aurora matains master election.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/matains/maintains/g
finder.go
Outdated
@@ -15,21 +15,20 @@ import ( | |||
) | |||
|
|||
const ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: remove the parentheses
spelling and formatting corrections
@tommyulfsparre do you have any preferences regarding how best to resolve this? Do you want to support |
@zircote so I think of not adding curator support for now and later support both, toggled with a cmdline flag. |
This allows for the aurora scheduler znode to be passed as
a flag at runtime. We rely on zk for multiple clusters and to enable this to work for us
it become necessary to allow us to direct the scraper to the correct znode. Let me know
your feedback on the pr looking forward to hearing back.